﻿@model Site
@{
	ViewBag.Title = "Page layouts";
}

@section help
{
	A page layout determines the page type and optionally the theme for a page. A page layout can also contain widgets that are displayed on every page that is linked to the layout.
}

<h2>@ViewBag.Title</h2>

<ul class="listview">
	@foreach (var pageLayout in Model.PageLayouts)
	{
		<li>
			<span class="item-title">@pageLayout.Name</span>
			<div class="item-sub">
				Page type:
				<span class="item-value">@this.CmsContext.Site.GetPageTypeById(@pageLayout.PageType).DisplayName</span>
				Theme:
				<span class="item-value">
					@if (String.IsNullOrEmpty(pageLayout.Theme)) {
						@: inherit from site
					} else {
						@pageLayout.Theme
					}
				</span>
			</div>
			<div class="item-cmds">
				@Html.ActionLink("Edit", "Update", new { id = pageLayout.Id }, new { @class = "cmd" })
				@Html.ActionLink("Configure widgets", "Widgets", new { id = pageLayout.Id }, new { @class = "cmd" })
				@using (Html.BeginForm("Delete", "Layouts", new { id = pageLayout.Id }, FormMethod.Post, new { @class = "inline" })) {
					@Html.AntiForgeryToken()
					<a href="#" class="cmd deletelink">Delete</a>
				}
				&nbsp;
			</div>
		</li>
	}
</ul>

@section sidebar {
	<ul>
		<li>@Html.ActionLink("New page layout", "Create")</li>
	</ul>
}

